Skip to content

Cleanup offload datatransfer#151640

Open
ZuseZ4 wants to merge 1 commit intorust-lang:mainfrom
ZuseZ4:cleanup-datatransfer
Open

Cleanup offload datatransfer#151640
ZuseZ4 wants to merge 1 commit intorust-lang:mainfrom
ZuseZ4:cleanup-datatransfer

Conversation

@ZuseZ4
Copy link
Member

@ZuseZ4 ZuseZ4 commented Jan 25, 2026

There are 3 steps to run code on a GPU: Copy data from the host to the device, launch the kernel, and move it back.
At the moment, we have a single variable describing the memory handling to do in each step, but that makes it hard for LLVM's opt pass to understand what's going on. We therefore split it into three variables, each only including the bits relevant for the corresponding stage.

cc @jdoerfert @kevinsala

r? compiler

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 25, 2026
@ZuseZ4 ZuseZ4 added the F-gpu_offload `#![feature(gpu_offload)]` label Jan 25, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch 2 times, most recently from d9def93 to 4f29cbe Compare January 25, 2026 09:57
@rust-log-analyzer

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch 2 times, most recently from 014d61d to 6b45680 Compare January 25, 2026 23:32
@ZuseZ4 ZuseZ4 marked this pull request as ready for review January 26, 2026 03:47
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 26, 2026
@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Jan 26, 2026

I don't think jieyouxu will want to review this part of rustc.
r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned jieyouxu Jan 26, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2026

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

@rust-bors

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch from 6b45680 to 1c28bd8 Compare January 29, 2026 22:16
@rustbot

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch 2 times, most recently from c310bf7 to b2b51e4 Compare January 29, 2026 23:09
@ZuseZ4 ZuseZ4 mentioned this pull request Feb 2, 2026
5 tasks
@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Feb 2, 2026

@rustbot reroll

@rustbot rustbot assigned nnethercote and unassigned oli-obk Feb 2, 2026
@rust-lang rust-lang deleted a comment from rustbot Feb 2, 2026
@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch from b2b51e4 to 3fb0092 Compare February 2, 2026 04:20
@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2026

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch from 3fb0092 to 446bd1d Compare February 2, 2026 04:21
@rust-log-analyzer

This comment has been minimized.

@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Feb 2, 2026

spurious failure, cc @jieyouxu
I think the doc ones fail somewhat often, lately? But I couldn't find this one in the open issues.

@RalfJung
Copy link
Member

RalfJung commented Feb 2, 2026

There's an issue at #93784.

@rust-bors

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch from 446bd1d to d8a440f Compare February 5, 2026 23:09
@rustbot

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch from d8a440f to 544a019 Compare February 6, 2026 20:36
@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

The individual commits seem like they don't have a reason to be separate, so please squash them.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch from 544a019 to b28b622 Compare February 8, 2026 01:03
@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Feb 8, 2026

One of the commits had gotten lost over one of the last rebases. I've re-added it and fused them.

@nnethercote
Copy link
Contributor

r=me, just one question about the subset operation above.

@ZuseZ4 ZuseZ4 force-pushed the cleanup-datatransfer branch from b28b622 to 6de0591 Compare February 8, 2026 01:34
@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Feb 8, 2026

@bors r=nnethercote rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 8, 2026

📌 Commit 6de0591 has been approved by nnethercote

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 8, 2026
…thercote

Cleanup offload datatransfer

There are 3 steps to run code on a GPU: Copy data from the host to the device, launch the kernel, and move it back.
At the moment, we have a single variable describing the memory handling to do in each step, but that makes it hard for LLVM's opt pass to understand what's going on. We therefore split it into three variables, each only including the bits relevant for the corresponding stage.

cc @jdoerfert @kevinsala

r? compiler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. F-gpu_offload `#![feature(gpu_offload)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants